package Algoritmo.recursivo;

import java.util.Scanner;

public class MCD {

	private static int MCD(int x, int y){
		
		System.out.println(x+"\t"+y);
		 if (y==0) {
	            return x;
	}
	         else {
	            return MCD( y, x % y );
	}
	
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 mcd();
	}
	
		public static void mcd() {
			
			Scanner scanner=new Scanner(System.in);
			
			System.out.print("Introduce x: ");
			int x=scanner.nextInt();
			
			System.out.print("Introduce y: ");
			int y=scanner.nextInt();
			
			scanner.close();
			
			System.out.println("mcd("+x+","+y+")="+MCD(x,y));
			
		
		      }
}


